from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import declarative_base

# 为 SQLAlchemy 定义数据库 URL地址
SQLALCHEMY_DATABASE_URL = 'mysql+pymysql://root:xx123456@39.98.46.92:3309/new_fast'

# 创建 SQLAlchemy 引擎
engine = create_engine(SQLALCHEMY_DATABASE_URL)
# 创建一个SessionLocal 数据库会话
SessionLocal = sessionmaker(autocommit=False, autoflush=False, bind=engine)

# 创建一个Model类
DbModel = declarative_base()